﻿using KisayolYoneticisi.Source.OpManager;
using KisayolYoneticisi.Source.Variables;
using System;

namespace KisayolYoneticisi.Source.BO
{
    public class Kisayol
    {

        #region [ Ctors ]

        public Kisayol(int Id)
        {
            _id = Id;
        }

        public Kisayol() { }

        #endregion


        #region [ Properties ]

        private int _id = -1;
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _kisayolAdi = "";
        public string KisayolAdi
        {
            get { return _kisayolAdi; }
            set { _kisayolAdi = value; }
        }

        private string _yol = "";
        public string Yol
        {
            get { return _yol; }
            set { _yol = value; }
        }

        private DateTime _tarih = AppVariables.DefaultTime;
        public DateTime Tarih
        {
            get { return _tarih; }
            set { _tarih = value; }
        }

        #endregion


        public Int32 Add()
        {
            try
            {
                return SQLiteManager.Add(this);
            }
            catch (Exception)
            {
                throw;
            }
        }


        public Int32 Update()
        {
            try
            {
                return SQLiteManager.Update(this);
            }
            catch (Exception)
            {
                throw;
            }
        }


        public Int32 Delete()
        {
            try
            {
                return SQLiteManager.Delete(this);
            }
            catch (Exception)
            {
                throw;
            }
        }

    }
}